FROM ubuntu:latest

MAINTAINER wang_sgang

RUN sed -i "s/archive.ubuntu/mirrors.aliyun/g" /etc/apt/sources.list && apt update

RUN apt install -y gcc g++ gfortran libfreetype6-dev libpng-dev liblapack-dev python3 python3-pip python3-psycopg2 libsnappy-dev

RUN mkdir ~/.pip && echo "[global]\nindex-url = https://mirrors.aliyun.com/pypi/simple/\n\n[install]\ntrusted-host=mirrors.aliyun.com">~/.pip/pip.conf && pip3 install --upgrade pip && sed -i "s/import main/import __main__/g" /usr/bin/pip3 && sed -i "s/main()/__main__._main()/g" /usr/bin/pip3 && pip3 install numpy && pip3 install scipy && pip3 install matplotlib && pip3 install scikit-learn && pip3 install pandas && pip3 install statsmodels && pip3 install jupyter && pip3 install tensorflow && pip3 install networkx && pack_path=/usr/local/lib/python3.6/dist-packages/ && sed -i "s/#font.family/font.family/g" ${pack_path}matplotlib/mpl-data/matplotlibrc && sed -i "s/#font.sans-serif     :/font.sans-serif     : simhei,/g" ${pack_path}matplotlib/mpl-data/matplotlibrc && sed -i "s/#axes.unicode_minus  : True/axes.unicode_minus  : False/g" ${pack_path}matplotlib/mpl-data/matplotlibrc && mkdir data && pip3 install neo4j && pip3 install python-snappy && pip3 install redis


ADD simhei.ttf /usr/local/lib/python3.6/dist-packages/matplotlib/mpl-data/fonts/ttf/simhei.ttf

EXPOSE 8888

CMD ["jupyter", "notebook","--allow-root","--ip=0.0.0.0","--port=8888"]

